import { ipcMain } from 'electron'
import { saveAnswer } from '../service/answer'

/*
answer-save 保存答案
*/

const answerController = () => {
  ipcMain.handle('answer-save', async (event, data) => {
    try {
      const res = await saveAnswer(data)
      return res
    } catch (error) {
      return []
    }
  })
}

export default answerController
